package com.demo.application.controller;

import com.demo.application.feign.ApplicationBClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author: kosam
 */
@RestController
public class DemoController {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private ApplicationBClient client;

    @GetMapping("/test")
    public String test() {
        logger.info(">>>>>>>>>>>>>>>>>>>start>>>>>>>>>>>>>>>>>>");
        String result = client.hello();
        return "Return : " + result;
    }

    @GetMapping("/")
    public String getInfo() {
        return "Application-A";
    }
}
